<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta charset="UTF-8">
    <title>用户列表</title>

    <link rel="stylesheet" th:href="@{/layui/css/layui.css}">
    <link rel="stylesheet" th:href="@{lib/css/main.css}">
    <link rel="stylesheet" th:href="@{/lib/css/public.css}">

    <script th:src="@{/lib/js/jquery-3.4.1.min.js}"></script>
    <script th:src="@{/layui/layui.js}"></script>



</head>




<body>

<div class="table">
    <h2 class="tablename">订单信息</h2>
    <hr class="layui-bg-gray">
    <table class="layui-hide" id="demo" lay-filter="test"></table>

    <div class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-body ">
                        <!--<form class="layui-form layui-col-space5">-->
                            <!--&lt;!&ndash;<div class="layui-inline layui-show-xs-block">&ndash;&gt;-->
                            <!--&lt;!&ndash;<input class="layui-input"  autocomplete="off" placeholder="开始日" name="start" id="start">&ndash;&gt;-->
                            <!--&lt;!&ndash;</div>&ndash;&gt;-->
                            <!--&lt;!&ndash;<div class="layui-inline layui-show-xs-block">&ndash;&gt;-->
                            <!--&lt;!&ndash;<input class="layui-input"  autocomplete="off" placeholder="截止日" name="end" id="end">&ndash;&gt;-->
                            <!--&lt;!&ndash;</div>&ndash;&gt;-->
                            <!--<div class="layui-inline layui-show-xs-block">-->
                                <!--<input type="text" name="username"  placeholder="请输入用户名" autocomplete="off" class="layui-input">-->
                            <!--</div>-->
                            <!--<div class="layui-inline layui-show-xs-block">-->
                                <!--<button class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>-->
                            <!--</div>-->
                        <!--</form>-->
                    </div>
                    <div class="layui-card-header">
                    <a class="layui-btn" href="/raddorder"><i class="layui-icon"></i>发布套餐</a>
                    </div>
                    <div class="layui-card-body ">
                        <table class="layui-table layui-form">
                            <thead>
                            <tr>

                                <th>寄养天数</th>
                                <th>洗澡次数</th>
                                <th>兜圈次数</th>
                                <th>拓展</th>
                                <th>订单备注</th>
                                <th>订单状态</th>
                                <th>操作</th>
                            </thead>
                            <div th:each="j:${list.list}">
                                <tbody>
                                <tr>

                                    <td th:text="${j.petDate}">1</td>
                                    <td th:text="${j.petTake}">admin</td>
                                    <td th:text="${j.petNum}">18925139194</td>
                                    <td th:text="${j.tuozhan}">113664000@qq.com</td>
                                    <td th:text="${j.beizhu}">超级管理员</td>
                                    <div th:if=" ${j.status} eq '0'">
                                        <td>正在寄养</td>
                                    </div>
                                    <div th:if=" ${j.status} != '0'">
                                        <td>已完成</td>
                                    </div>
                                    <td>
                                        <a th:onclick="|javascript:rrr('${j.id}')|" class="layui-btn layui-btn-normal layui-btn-radius">完成订单</a>
                                        <a th:href="${'/rpingjia?id='+j.id}" class="layui-btn layui-btn-normal layui-btn-radius">查看评价</a>
                                    </td>
                                    <!--<td></td>-->
                                    <!--<td class="td-status">-->
                                    <!--<span class="layui-btn layui-btn-normal layui-btn-mini">已启用</span></td>-->
                                    <!--<td class="td-manage">-->
                                    <!--&lt;!&ndash;<button type="button" class="layui-btn layui-btn-normal layui-btn-radius">完成订单</button>&ndash;&gt;-->
                                    <!--&lt;!&ndash;<button type="button" class="layui-btn layui-btn-normal layui-btn-radius">查看评价</button>&ndash;&gt;-->
                                    <!--&lt;!&ndash;<a onclick="member_stop(this,'10001')" href="javascript:;"  title="启用">&ndash;&gt;-->
                                    <!--&lt;!&ndash;<i class="layui-icon">&#xe601;</i>&ndash;&gt;-->
                                    <!--&lt;!&ndash;</a>&ndash;&gt;-->
                                    <!--&lt;!&ndash;<a title="编辑"  onclick="xadmin.open('编辑','admin-edit.html')" href="javascript:;">&ndash;&gt;-->
                                    <!--&lt;!&ndash;<i class="layui-icon">&#xe642;</i>&ndash;&gt;-->
                                    <!--&lt;!&ndash;</a>&ndash;&gt;-->
                                    <!--&lt;!&ndash;<a title="删除" onclick="member_del(this,'要删除的id')" href="javascript:;">&ndash;&gt;-->
                                    <!--&lt;!&ndash;<i class="layui-icon">&#xe640;</i>&ndash;&gt;-->
                                    <!--&lt;!&ndash;</a>&ndash;&gt;-->
                                    <!--</td>-->
                                </tr>
                            </div>
                            </tbody>
                        </table>
                    </div>
                    <div class="layui-card-body ">
                        <div class="page">
                            <div>
                                当前页: [[${list.pageNum}]] 总页数：[[${list.pages}]] 总条数：[[${list.total}]] <a class="layui-btn layui-btn-normal layui-btn-radius" href="#" onclick="index()">首页</a>    <a href="#" class="layui-btn layui-btn-normal layui-btn-radius" onclick="shangyiye()">上一页</a> <a class="layui-btn layui-btn-normal layui-btn-radius" id="pagenext"  href="#" onclick="xiayiye()" >下一页</a> <a class="layui-btn layui-btn-normal layui-btn-radius" href="#" onclick="wenye()">尾页</a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>

    function rrr(orderId){
      //  alert(orderId)
        $.ajax({
            url:"/rrrorder",
            data:{"id":orderId},
            type:"POST",
            success:function(data){
                if(data == 1){
                    alert("完成订单成功！")
                    window.location.reload()
                }
            },
            error:function (){
                alert("系统内部出错,请联系管理员！")
            }
        })
    }


    //首页
    function index(){
        //name
        // var  name =  $("#studentname").val()
        //首页
    //    var userId = [[${userId}]];
        var pageNum= 1;
        location.href="/orderlist?pageNum="+pageNum;
    }

    //上一页
    function shangyiye(){

        //上一页
        var  shangy =  [[${list.prePage}]]

        location.href="/orderlist?pageNum="+shangy;
    }

    //下一页
    function xiayiye(){

        var pageNum = [[${list.pageNum}]]

        var info = [[${list.pages}]]
        //当前页等于总条数的时候就是最后一页！
        if(pageNum == info){
            alert("亲，已经是最后一页了！")
            return false;
        }
        // var  name =  $("#studentname").val()
        //下一页
        var xiay =  [[${list.nextPage}]]
        location.href="/orderlist?pageNum="+xiay;
    }

    //尾页
    function wenye(){

        //  //尾页
        var wenye =  [[${list.pages}]]
        location.href="/orderlist?pageNum="+wenye;
    }



</script>


</body>

</html>